// 导入request
import request from '@/utils/request'

// 获取组织
export function getDepartments() {

    return request({
        url: '/company/department'
    })
}

//删除
export function delDepartments(id) {
    return request({
        url: `/company/department/${id}`,
        method: 'delete'
    })
}

// 新增部门
export function addDepartment(data) {
    return request({
        url: '/company/department',
        method: 'post',
        data
    })

}

// 根据id查询部门详情
export function getDepartmentById(id) {
    return request({
        url: `/company/department/${id}`
    })

}
// 编辑部门
export function editDepartment(data) {
    return request({
        url: `/company/department/${data.id}`,
        method: 'put',
        data
    })
}